﻿using System;
using System.Collections.Generic;
using DC2010.Objects.Base;
using DC2010.Objects.Common;
using DC2010.Objects.Logic;
using System.Xml.Serialization;

namespace DC2010.Objects.Data
{
    public class ActionData : BaseData
    {
        /// <summary>
        /// Skill to be improved
        /// </summary>
        [XmlAttribute]
        public SkillNames ImprovedSkill { get; set; }

        /// <summary>
        /// How much experience u will gain
        /// </summary>
        [XmlAttribute]
        public int ExperienceGain { get; set; }

        /// <summary>
        /// Defense modifier applied until the champion can make an action again.
        /// </summary>
        [XmlAttribute]
        public int DefenseModifier { get; set; }

        /// <summary>
        /// The base value of stamina used when making the action.
        /// </summary>
        [XmlAttribute]
        public int Stamina { get; set; }


        /// <summary>
        /// Damage modifier (in 1/32's). A value of 16 then would be "half normal damage".
        /// </summary>
        [XmlAttribute]
        public int Damage { get; set; }

        /// <summary>
        ///  The amount of time before you can make another action (1/6ths of a second).
        /// </summary>
        [XmlAttribute]
        public int Fatique { get; set; }

        /// <summary>
        /// How many charges. For example staff with ability to throw fireballs...if current charges=0 than this action cannot be executed.
        /// </summary>		
        public CurrentNormal Charges { get; set; }


        public ActionData()
        {
        }
		
        public ActionGfx Gfx
        {
            get
            {
                if (!string.IsNullOrEmpty(GfxId))
                {
                    return Root.I.ActionSystem.GetGfx(GfxId);
                }

                return null;
            }
        }		

        private ActionLogic _l;
        public ActionLogic L
        {
            get
            {
                if (_l == null)
                    _l = new ActionLogic(this);

                return _l;
            }
        }
    }
}
